A magnetic tape subsystem is generally composed of: a magnetic tape apparatus including a magnetic tape, a tape head, and a tape loading mechanism; and a magnetic tape control apparatus. The magnetic tape control apparatus performs a control of a magnetic tape apparatus, which control is required when data are recorded on a magnetic tape (data write), or when data on a magnetic tape are read.
A method called "an extended data recording method" has been proposed as a method of recording data on a magnetic tape. This "extended data recording method" was proposed by ANSI (American National Standard Institution) in 1989 as a method to increase storage capacity per a cartridge tape. The contents of the proposal by ANSI are contained in the following handbook.
"X3B5 EXTENDED MAGNETIC TAPE FORMAT FOR INFORMATION INTERCHANGE 18-TRACK, PARALLEL, 12.65 MM (1/2 in), 1491 CPMM (37 871 cpi) Group-Coded Recording".
A description will now be given of the "extended data recording method" described in this handbook, with reference to FIGS.1 and 2.
In the "extended data recording method", data are recorded on a magnetic tape in accordance with an extended data format as shown in FIG.1. Referring to FIG. 1, a data block recorded on a magnetic tape is composed of a plurality of packets and a count field. The data block has a data block ID and a pad positioned after it. The data block ID is composed of a sector number, an identification code, and a physical block ID. Each packet is composed of a packet header (PH), a data, and a packet trailer (PT), the details of the packet format being shown in FIG.2. Referring to FIG. 2, the packet header PH is composed of a block ID, a packet offset, a packet trailer length, a flag, a reserve, and a CRC (error correcting code), the block ID being composed of an identification code, a sector number, and a logical record ID. The packet trailer PT provided in a non-compressed data packet and the packet trailer PT provided in a compressed data packet have different compositions. The packet trailer PT provided in the non-compressed data packet is composed of a trailer pad and a packet CRC, while the packet trailer PT provided in the compressed data packet is composed of a logical block length, a logical block CRC, a compressed data block CRC, a trailer pad, and a packet CRC. The packet header PH and the packet trailer PT of each packet are the information required when restoring data read from a magnetic tape to an original data, and are formed at the time of data recording so as to be added before and after the data respectively.
In accordance with the above-mentioned extended data format, it is possible to decrease the number of IBG (inter-block gap) which have to be provided between data blocks, because a plurality of packets are combined into one physical block, and data are recorded on a magnetic tape in units of this physical block (data block). As a result of this decrease, the storage capacity per a magnetic tape can be increased.
In order to record data on a magnetic tape in accordance with the above-described "extended data recording method", the magnetic tape control apparatus needs to be equipped with a function called autoblocking. This autoblocking is a kind of data compression technology. In response to a data read/write command given from a host computer for packet units, i.e., for logical block units, the magnetic tape control apparatus processes, by means of this autoblocking function, reads/writes data in the above-mentioned physical block units. For example, when the magnetic tape control apparatus receives a write command WR and data from the host computer, data are recorded on a magnetic tape in the following manner.
Data received from the host computer is compressed, and a packet is formed by adding the packet header PH and the packet trailer PT to the compressed data. A plurality of packets thus formed (P.sub.1, P.sub.2, P.sub.3, P.sub.4, P.sub.5) are combined into one physical block. The data block ID, etc., are added to this one physical block, the result of the addition being written on the magnetic tape. The sequential recording on a magnetic tape is effected such that an IBG is provided for each physical block.
When the magnetic tape control apparatus receives a read command from the host computer, data are read from the magnetic tape in physical block units, and original data are restored from the read data, using such information as the packet header PH and the packet trailer PT. As described before, a data format exchanged between the host computer and the magnetic tape control apparatus is not an extended data format. Also, the read/write command (RD, WR) from the host computer is issued to be executed on each packet of data, i.e., on each logical block unit. On the other hand, the magnetic tape control apparatus effects a read/write process for each physical block unit. Accordingly, in the case where the data having a physical block composed of five packets P.sub.1 -P.sub.5 is recorded on the magnetic tape, as is shown in FIG. 3, and a first read command RD is executed on the packet P.sub.1 data, a second read command RD on the packet P.sub.2 data, and a third read command RD on the packet P.sub.3 data, in a sequential manner, the magnetic tape control apparatus reads (stores in a buffer) the physical block composed of the packets P.sub.1 -P.sub.5 upon receipt of the first read command RD. Thereupon, in correspondence to the first, second, and third read commands, only the data in the packets P.sub.1, P.sub.2, and P.sub.3 are fetched and restored to the original data. The restored data (read data) are then sent to the host computer.
When a write command WR to be executed on the packet P.sub.4 is issued from the host computer immediately after the third read command RD is executed, the magnetic tape control apparatus cannot execute this write command since the apparatus is not capable of processing a write operation at packet unit level.
Accordingly, a data recording control method is possible in which this write command, issued immediately after the execution of the read command, is made executable by reorganizing the data in the physical block to be processed. Such a control method is schematically shown in FIGS. 4 and 5.
As shown in FIG.4, when write commands are 4-9 sequentially issued after read commands 1-3 are executed on the data in the packets P.sub.1 -P.sub.3 belonging to the physical block consisting of five packets P.sub.1 -P.sub.5, the following processes are effected.
First, when the read command 1 on the data in the packet P.sub.1 is executed, the tape head reads, from the magnetic tape, all the data in the physical block consisting of the packets P.sub.1 -P.sub.5, and the read data are then stored in the buffer, as shown in FIG.5 1. The data in the packet P.sub.1 is transferred from the buffer to the host computer, in correspondence to the read command RD 1. As shown in FIG. 5 2 and 3, when the read commands RD 2 and 3 are executed, the data in the packets P.sub.2 and P.sub.3 are transferred, in response to these commands, from the buffer to the host computer in a sequential manner. When a write command WR 4 is output from the host computer, the tape head is positioned at the packet P.sub.1 residing on the magnetic tape (4-1). Since the data in the packets P.sub.1 -P.sub.3 need to be retained as they are on the magnetic tape, the data in the packets P.sub.1 -P.sub.3 in the buffer are written unmodified on the magnetic tape via the tape head, as shown in FIG. 5 4-2. A new data P.sub.4N, output together with the write command WR 4 from the host computer, is stored in the buffer as shown in FIG. 5 4-3. Thereafter, when write commands WR 5, 6, 7 and 8 are sequentially output from the host computer, new write data P.sub.5N, P.sub.6N, P.sub.7N, and P.sub.8N, output together with these write commands from the host computer, are sequentially stored in the buffer (FIG. 5 5-8-1). When the quantity of write data fulfills a predetermined condition (close condition), an IBG is provided after the data block consisting of the packets P.sub.1, P.sub.2, and P.sub.3, after which the data P.sub.5N -P.sub.8N fulfilling that condition are written on the magnetic tape via the tape head (FIG. 5 8-2).
By performing the data block reorganization according to the above-described procedure, when the write command WR is executed immediately after the execution of the read command RD in one given physical block, data recording on the magnetic tape in accordance with an "extended data recording method" is achieved.
However, when the write command WR is executed immediately after the execution of the read command RD, generation of one physical block consisting of the data (P.sub.1, P.sub.2, P.sub.3) that have been read up to that point is compelled, thus causing the data length of the physical block thus generated to be smaller than a data length of a normal physical block. This has a disadvantage in that the number of IBGs tends to be substantially large, and data storage capacity per a magnetic tape becomes is reduced, if the read command RD and the write command WR are repeated.